﻿using System;
using System.Collections.Generic;
using System.Runtime.InteropServices;
using System.Text;

namespace FakeUnity.Warp
{
    //public static class SceneNative
    //{
    //    public const string nativelib = "fakeunity.native.player";


    //    //这里是占位用的，因为SceneHandle 原来就是保存了一个WeakPtr，其内部就是两个指针，这样定义保证长度和c++对应
    //    public struct SceneHandle
    //    {
    //        UInt32 handle;
    //    }
    //    public enum ActiveOption
    //    {
    //        Active = 1,
    //        Deactive = 0,
    //    };
    //    public struct TransformHandle
    //    {
    //        UInt32 handle;
    //    }
    //    public enum RemoveNodeOption
    //    {
    //        RemoveChild,
    //        FailIfHaveChild,
    //    };

    //    [DllImport(nativelib, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Unicode)]
    //    public static extern SceneHandle Scene_Create(string name);

    //    [DllImport(nativelib, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Unicode)]
    //    public static extern void Scene_Remove(SceneHandle scene);

    //    [DllImport(nativelib, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Unicode)]
    //    public static extern int Scene_Count();

    //    [DllImport(nativelib, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Unicode)]
    //    public static extern SceneHandle Scene_FindByIndex(int index);



    //    //场景名字
    //    [DllImport(nativelib, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Unicode)]
    //    public static extern void Scene_SetName(SceneHandle scene, string name);


    //    [DllImport(nativelib, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Unicode)]
    //    public static extern IntPtr Scene_GetName(SceneHandle scene);

    //    //场景是否活动
    //    [DllImport(nativelib, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Unicode)]
    //    public static extern void Scene_SetActive(SceneHandle scene, ActiveOption active);


    //    [DllImport(nativelib, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Unicode)]
    //    public static extern ActiveOption Scene_GetActive(SceneHandle scene);





    //    [DllImport(nativelib, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Unicode)]
    //    public static extern TransformHandle Scene_GetRoot(SceneHandle scene);




    //    /// <summary>
    //    /// ///////////////////////////////scene node
    //    /// </summary>

    //    [DllImport(nativelib, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Unicode)]
    //    public static extern TransformHandle SceneNode_Create(TransformHandle parent, string name);

    //    [DllImport(nativelib, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Unicode)]
    //    public static extern void SceneNode_Move(TransformHandle handle, TransformHandle parent);

    //    [DllImport(nativelib, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Unicode)]
    //    public static extern void SceneNode_Remove(TransformHandle handle, RemoveNodeOption optin = RemoveNodeOption.RemoveChild);

    //    [DllImport(nativelib, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Unicode)]
    //    public static extern int SceneNode_ChildCount(TransformHandle handle);

    //    [DllImport(nativelib, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Unicode)]
    //    public static extern TransformHandle SceneNode_FindChildByIndex(TransformHandle handle, int index);
    //}
}
